<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Watermark 水印</title>
	<link rel="stylesheet" href="../static/css/reset.css">
	<script src="../static/js/vue.global.prod.js"></script>
	<script src="../static/js/antd.min.js"></script>
	<script src="../static/js/icons_antd.js"></script>
</head>
<body>

<div id="app">
	<a-divider class="a-divi" orientation="left">基本</a-divider><!-- =============================================================== -->
	<p class="desc">最简单的用法。</p>
	<a-watermark content="Ant Design Vue">
		<div style="height: 500px"></div>
	</a-watermark>
	
	<a-divider class="a-divi" orientation="left">多行水印</a-divider><!-- =============================================================== -->
	<p class="desc">通过 content 设置 字符串数组 指定多行文字水印内容。</p>
	<a-watermark :content="['Ant Design Vue', 'Happy Working']">
		<div style="height: 500px"></div>
	</a-watermark>
	
	<a-divider class="a-divi" orientation="left">图片水印</a-divider><!-- =============================================================== -->
	<p class="desc">通过 image 指定图片地址。为保证图片高清且不被拉伸，请设置 width 和 height, 并上传至少两倍的宽高的 logo 图片地址。</p>
	<a-watermark :height="30" :width="130" :image="img2">
		<div style="height: 500px"></div>
	</a-watermark>
	
	<a-divider class="a-divi" orientation="left">自定义配置</a-divider><!-- =============================================================== -->
	<p class="desc">通过自定义参数配置预览水印效果。</p>
	<div style="display: flex">
		<a-watermark v-bind="model">
			<a-typography>
				<a-typography-paragraph>
					The light-speed iteration of the digital world makes products more complex. However, human
					consciousness and attention resources are limited. Facing this design contradiction, the
					pursuit of natural interaction will be the consistent direction of Ant Design.
				</a-typography-paragraph>
				<a-typography-paragraph>
					Natural user cognition: According to cognitive psychology, about 80% of external
					information is obtained through visual channels. The most important visual elements in the
					interface design, including layout, colors, illustrations, icons, etc., should fully
					absorb the laws of nature, thereby reducing the user&apos;s cognitive cost and bringing
					authentic and smooth feelings. In some scenarios, opportunely adding other sensory
					channels such as hearing, touch can create a richer and more natural product experience.
				</a-typography-paragraph>
				<a-typography-paragraph>
					Natural user behavior: In the interaction with the system, the designer should fully
					understand the relationship between users, system roles, and task objectives, and also
					contextually organize system functions and services. At the same time, a series of methods
					such as behavior analysis, artificial intelligence and sensors could be applied to assist
					users to make effective decisions and reduce extra operations of users, to save
					users&apos; mental and physical resources and make human-computer interaction more
					natural.
				</a-typography-paragraph>
			</a-typography>
			<img style="z-index: 10; width: 100%; max-width: 800px; position: relative" :src="img4" alt="示例图片" />
		</a-watermark>
		<a-form style="width: 280px;flex-shrink: 0;border-left: 1px solid #eee;padding-left: 20px;margin-left: 20px;" layout="vertical" :model="model">
			<a-form-item name="content" label="Content">
				<a-input v-model:value="model.content"></a-input>
			</a-form-item>
			<a-form-item name="font.fontSize" label="FontSize">
				<a-slider v-model:value="model.font.fontSize" :step="1" :min="0" :max="100"></a-slider>
			</a-form-item>
			<a-form-item name="zIndex" label="zIndex">
				<a-slider v-model:value="model.zIndex" :step="1" :min="0" :max="100"></a-slider>
			</a-form-item>
			<a-form-item name="rotate" label="Rotate">
				<a-slider v-model:value="model.rotate" :step="1" :min="-180" :max="180"></a-slider>
			</a-form-item>
			<a-form-item label="Gap" style="margin-bottom: 0">
				<a-space style="display: flex" align="baseline">
					<a-form-item :name="['gap', 0]">
						<a-input-number v-model:value="model.gap[0]" placeholder="gapX"></a-input-number>
					</a-form-item>
					<a-form-item :name="['gap', 1]">
						<a-input-number v-model:value="model.gap[1]" placeholder="gapY"></a-input-number>
					</a-form-item>
				</a-space>
			</a-form-item>
			<a-form-item label="Offset" style="margin-bottom: 0">
				<a-space style="display: flex" align="baseline">
					<a-form-item :name="['offset', 0]">
						<a-input-number v-model:value="model.offset[0]" placeholder="offsetLeft"></a-input-number>
					</a-form-item>
					<a-form-item :name="['offset', 1]">
						<a-input-number v-model:value="model.offset[1]" placeholder="offsetTop"></a-input-number>
					</a-form-item>
				</a-space>
			</a-form-item>
		</a-form>
	</div>
	
	
</div>
<div class="h100"></div>

</body>
<script>
const Main = {
data() {
	return {
		img1: 'https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*lkAoRbywo0oAAAAAAAAAAAAADrJ8AQ/original',
		img2: '../static/img/ant.png',
		
		model: {
			content: 'Ant Design Vue',
			font: {fontSize: 16,},
			zIndex: 11,
			rotate: -22,
			gap: [100, 100],
			offset: [0, 0],
		},
		img3: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ',
		img4: '../static/img/work.png',
		
	}
},
methods:{
	fn(){
		this.message = "欢迎来到HTML中文网。";
	},
	hello(par){
		this.message = "参数值为：" + par;
	},
	
	
},
}

const app = Vue.createApp(Main);
for (const [key, component] of Object.entries(AntdIconsVue)) {app.component(key, component)};
app.use(antd);
let vm = app.mount("#app");


</script>
</html>
